<template>
	<view>
		<scroll-view :scrollIntoView="'cat-'+param.cat_index" scrollY="true" :style="{width:upx_550,maxHeight: WindowHeight+'px'}">
        <view class="diy-goods-list-1">
            <block v-for="(item,index) in param.list" :key="item.id">
                <view class="diy-cat-name" :id="'cat-'+index">
                    <view class="text-more" style="width:170upx;">{{item.name}}</view>
                </view>
                <view class="diy-goods-1 flex-row" v-for="(value,key) in item.goods_list" :key="value.id">
                    <view class="flex-grow-1">
                        <form @submit="$emit('_formIdSubmit',$event)" data-type="navigate" :data-url="'/pages/goods/goods?id='+value.goods_id" reportSubmit="true">
                            <button formType="submit" id="_formIdSubmit" class="_formIdSubmit">
                                <view class="flex-row">
                                    <view class="flex-grow-0 diy-goods-img">
                                        <image lazyLoad="true" mode="aspectFill" :src="value.pic_url"></image>
                                        <image class="diy-goods-mark" lazyLoad="true" mode="aspectFill" :src="param.mark_url" v-if="param.mark==1"></image>
                                    </view>
                                    <view class="flex-grow-1 ml-24 flex-col" style="justify-content:space-between;">
                                        <view class="text-more-2" v-if="param.name==1">{{value.name}}</view>
                                        <view class="red" style="margin-top:10upx;" v-if="param.price==1">￥{{value.price}}</view>
                                    </view>
                                </view>
                            </button>
                        </form>
                    </view>
                    <view class="flex-grow-0 flex-y-bottom">
                        <form @submit="$emit('_formIdSubmit',$event)" data-bind="modalShowGoods" :data-cat="index" :data-goods="key" :data-template="template_index" reportSubmit="true">
                            <button formType="submit" id="_formIdSubmit" class="_formIdSubmit">
                                <view class="buy-btn" v-if="param.buy==1">
                                    <view :class="['text-more', 'buy-btn-'+param.buy_list]" v-if="param.buy_list>=2">{{param.buy_content?param.buy_content:'购买'}}</view>
                                    <image lazyLoad="true" mode="aspectFill" :src="param.buy_content" v-else></image>
                                </view>
                            </button>
                        </form>
                    </view>
                </view>
            </block>
        </view>
    </scroll-view>
	</view>
</template>

<script>var myVue = {};
	export default {
		computed: {
			upx_550() {
				return uni.upx2px(550)+'px';
			}
		},
		props:['param','template_index','WindowHeight','type'],
		data() {
			return {
				
			};
		}
	}
</script>

<style scoped>

</style>
